package easy;

public class Solution_485 {
    public int findMaxConsecutiveOnes(int[] nums) {
        int count = 0, maxCount = 0;
        for (int num : nums) {
            if (num == 1) {
                count++;
            } else {
                maxCount = Math.max(maxCount, count);
                count = 0;
            }
        }
        return Math.max(maxCount, count);
    }

    public static void main(String[] args) {
        Solution_485 model = new Solution_485();
        System.out.println(model.findMaxConsecutiveOnes(new int[]{1,1,0,1,1,1}));
        System.out.println(model.findMaxConsecutiveOnes(new int[]{}));
    }
}
